package com.ymttest.database.sqlwapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.discount_info;
import com.ymttest.database.model.discount_info;
import com.ymttest.utils.EnvSetup;

public class discount_infoWapper {
	SqlManager manager;

    public discount_infoWapper() {
        manager = new SqlManager("mysqlplatformdiscounts" + EnvSetup.getEnv());
    }

    public   discount_info selectTop1(discount_info record)  {
    	discount_info model=new discount_info();
        List<discount_info> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.discount_infoMapper.selectTop1",
                        record);
        if(result.size()>0)
        	model=result.get(0);
        manager.commit();
        return model;
    }

    
    public   int selectCount(discount_info record)  {
        List<discount_info> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.discount_infoMapper.selectCount",
                        record);
        manager.commit();
        return result.size();
    }
    
    public int updateByPrimaryKey(discount_info record) {
        int result = manager.update(
                        "com.ymttest.database.mapping.discount_infoMapper.updateByPrimaryKey",
                        record);
        manager.commit();
        return result;
    }
    
  
    public static void main(String[] args) {
    	discount_infoWapper test = new discount_infoWapper();
    	
    	discount_info record=new discount_info();
		record.setUserId(49386);
		record.setProductId("e397d15b-4ee8-43d0-8c19-01748a16a077");
		
       System.out.println(test.selectTop1(record).getDiscountId());
       
        // test.insertYmtCouponSetting(3,11);
        // Logger.debug(test.getLastYmtCouponSettingId());


    }
}
